/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DialogBillDetail.java
 *
 * Created on Feb 15, 2012, 3:53:22 PM
 */
package GUI;

import Model.BillDetailTableModel;
import Entity.BillDetail;
import Entity.ConnectionSQL;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.JTable;

/**
 *
 * @author TieuHaPhong
 */
public class DialogBillDetail extends javax.swing.JDialog {
    ResourceBundle message;
    BillDetailTableModel billDetailModel;
    
    /** Creates new form DialogBillDetail */
    public DialogBillDetail(java.awt.Frame parent, boolean modal,List<BillDetail> list) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(parent);
        message = ResourceBundle.getBundle("messages",Locale.ENGLISH);
        
        billDetailModel = new BillDetailTableModel(list, message);
        tblBillDetail.setModel(billDetailModel);
        initComponents();
    }
    public DialogBillDetail(java.awt.Dialog parent, boolean modal,List<BillDetail> list) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(parent);
        message = ResourceBundle.getBundle("messages",Locale.ENGLISH);
        
        billDetailModel = new BillDetailTableModel(list, message);
        tblBillDetail.setModel(billDetailModel);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblBillDetail = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        jButton1.setText("OK");
        jPanel1.add(jButton1);

        getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END);

        jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, javax.swing.BoxLayout.LINE_AXIS));

        tblBillDetail.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(tblBillDetail);

        jPanel3.add(jScrollPane1);

        getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tblBillDetail;
    // End of variables declaration//GEN-END:variables
}
